import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;

/**
 * Created by li_wb on 2017/9/22.
 */
@Aspect
public class LogAspect {
    @Around(value = "execution(* com.ctrip.controllers..*.*(..)) && @annotation(loggable)")
    public Object around(ProceedingJoinPoint joinPoint, ILogable loggable) throws Throwable {
        System.out.println("i am from controller");
        return joinPoint.proceed();
    }

    @Around(value = "execution(* com.ctrip.service..*.*(..)) && @annotation(loggable)")
    public Object around1(ProceedingJoinPoint joinPoint, ILogable loggable) throws Throwable {
        System.out.println("i am from service");
        return joinPoint.proceed();
    }
}
